#!/bin/bash
docker build -t registry.cn-chengdu.aliyuncs.com/lyscms/overallstudy:1.0 .
# 检查 Docker 镜像构建是否成功
if [ $? -ne 0 ]; then
  echo "==========【Docker 镜像构建失败，请修复错误后重新提交！】=========="
  exit 1
fi
echo "==========【Docker 镜像构建成功，正在推送到阿里镜像仓库中...】=========="
docker push registry.cn-chengdu.aliyuncs.com/lyscms/overallstudy:1.0
# 检查 推送到阿里镜像仓库是否成功
if [ $? -ne 0 ]; then
  echo "==========【推送到阿里镜像仓库失败，请修复错误后重新推送！】=========="
  exit 1
fi
echo "==========【推送到阿里镜像仓库完成】=========="